

#include <interpolateNode.h>
#include <control.h>
#include <input.h>

InterpolateNode::InterpolateNode(){

name="Interpolate";

listType.push_back("15PickWorldButton");
listName.push_back("moveActor");

listType.push_back("15PickWorldButton");
listName.push_back("targetActor");

color=Vector4f(0.5,0.5,0.5,1.0);
registerProperties();
}

InterpolateNode::~InterpolateNode(){}

void InterpolateNode::registerProperties(){

Node::registerProperties();
//createMemberID("WAITTIME",&waitTime,this);
}

void InterpolateNode::start(){

//create interpolationHelper
//moveActor->movers.push_back(new InterpolationHelper);
//moveActor->mover->targetActor=targetActor;
//cout << "executing interpolation: " << moveActor->name << "with target: " << moveActor->mover->targetActor->name << endl;
}

void InterpolateNode::stop(){

}

void InterpolateNode::execute(){

    //TODO: if (bWaitForMoveActor && moveActor->mover)

}


void InterpolateNode::update(double deltaTime){

Node::update(deltaTime);
}

void InterpolateNode::trigger(Actor * other){

Node::trigger(other);

if (other==listButton[0] && input->worldTarget)
    {
    moveActor=input->worldTarget;
    cout << "InterpolationNode triggered!!!" << moveActor->name << endl;
    }
if (other==listButton[1] && input->worldTarget)
    {
    targetActor=input->worldTarget;
    cout << "InterpolationNode triggered!!!" << targetActor->name << endl;
    }
}

void InterpolateNode::create(){renderer->addNode(this);}
